<?php 
if(!isset($_SESSION)) 
{ 
	session_start(); 
}
$status=$_REQUEST['status'];
if($status==0){
	$l_ngaygiaodich=$l_ngaygiaodich0;
	$l_ngayphathanh=$l_ngayphathanh0;	
	$l_thoigiangiaodich=$l_thoigiangiaodich0;
}
if($status==1){
	$l_ngaygiaodich=$l_ngaygiaodich1;
	$l_ngayphathanh=$l_ngayphathanh1;	
	$l_thoigiangiaodich=$l_thoigiangiaodich1;
}
$mangquy=array(1,1,1,2,2,2,3,3,3,4,4,4);
$mq=array(1=>array(1,3),2=>array(4,6),3=>array(7,9),4=>array(10,12));
if(!isset($_REQUEST["abc"])){
	$_REQUEST["abc"]="all";
}
$_SESSION['loaitimkiem']=$_REQUEST["abc"];
if($_SESSION['loaitimkiem']=="ngay"){
	$_REQUEST['datefrom']=date("Y-m-d");
	$_REQUEST['dateto']=date("Y-m-d");
	$_REQUEST['vttime']=$_REQUEST['datefrom']." ~ ".$_REQUEST['dateto'];
}else if($_SESSION['loaitimkiem']=="thang"){
	$_REQUEST['syear']=$vyear=date("Y");
	$_REQUEST['smonths']=date("m");
	$ntt=date("t",mktime(0,0,0,$_REQUEST['smonths'],1,$_REQUEST['syear']));
	if($_REQUEST['smonths']<10){
		$_REQUEST['vttime']=$_REQUEST['syear']."-0".$_REQUEST['smonths']."-01"." ~ ".$_REQUEST['syear']."-0".$_REQUEST['smonths']."-".$ntt;
	}else{
		$_REQUEST['vttime']=$_REQUEST['syear']."-".$_REQUEST['smonths']."-01"." ~ ".$_REQUEST['syear']."-".$_REQUEST['smonths']."-".$ntt;
	}
}else if($_SESSION['loaitimkiem']=="qui"){
	$_REQUEST['qyear']=$vyear=date("Y");
	$_REQUEST['qmonths']=$mangquy[date("m")-1];
	$ntt=date("t",mktime(0,0,0,$mq[$_REQUEST['qmonths']][1],1,$_REQUEST['qyear']));
	if($mq[$_REQUEST['qmonths']][0]<10){
		$_REQUEST['vttime']=$_REQUEST['qyear']."-0".$mq[$_REQUEST['qmonths']][0]."-01"." ~ ".$_REQUEST['qyear']."-0".$mq[$_REQUEST['qmonths']][1]."-".$ntt;
	}else{
		$_REQUEST['vttime']=$_REQUEST['qyear']."-".$mq[$_REQUEST['qmonths']][0]."-01"." ~ ".$_REQUEST['qyear']."-".$mq[$_REQUEST['qmonths']][1]."-".$ntt;
	}
	
}
$_REQUEST['cbcus']="";
$arr=array();
$_SESSION['manginvoicetax']=array();
?>
<link rel="stylesheet" type="text/css" href="js/jquery.autocomplete.css" />
<script type="text/javascript" src="js/jquery.autocomplete.js"></script>
<style type="text/css">
#content_menu_expand{
	position:absolute; 
	right:-5px;
	top:20px;
	z-index:999;
	background-color: #ffffff;
	-moz-border-radius: 7px;
	-webkit-border-radius: 7px;
	color: #000000;
	width:300px; 
	max-height:180px;
	overflow:auto;
}
.passul{padding-left:0; border:1px solid black}
.bgkhac {background: #eee;}
.passul ul li {color:#474747; font-size:12px;padding: 5px 0;padding-left:5px;}
.passul ul li:hover { background: #0A246A;color:white;text-decoration: none;}
</style>
<script type="text/javascript">
$(document).ready(function(){
	$("#inputString").autocomplete("operations/rpc_search_invoice_tax.php", {
		selectFirst: true
	});
	$('#content_menu_expand').hide();
	$(document).click(function() {
		$("#content_menu_expand").hide();
	});
	$('#content_menu_expand').click(function(e) {
		e.stopPropagation();
	});

	$('#menu_expand').click(function() {
		if ($('#content_menu_expand').is(":hidden")) {
			var gt=document.getElementById("checkkhung").checked;
			if(gt==false){
				$('#content_menu_expand').show();
			}
		}
		else {
			$('#content_menu_expand').hide();
		}
		return false;
	});
	$('#close_menu').click(function() {
		$('#content_menu_expand').hide();
		return false;
	});

	$("ul.menu_inside li a").hover(function() {
		$(this).parent().find("ul.subnav").slideDown(0).show();
		$(this).parent().hover(function() {
		}, function(){
			$(this).parent().find("ul.subnav").slideUp(0);
		});
	}).hover(function() {
		$(this).addClass("subhover");
	}, function(){
		$(this).removeClass("subhover");
	});
});

function Load(){
	$("#inputString").autocomplete("operations/rpc_search_invoice_tax.php", {
		selectFirst: true
	});
	$('#content_menu_expand').hide();
	$(document).click(function() {
		$("#content_menu_expand").hide();
	});
	$('#content_menu_expand').click(function(e) {
		e.stopPropagation();
	});

	$('#menu_expand').click(function() {
		if ($('#content_menu_expand').is(":hidden")) {
			var gt=document.getElementById("checkkhung").checked;
			if(gt==false){
				$('#content_menu_expand').show();
			}
		}
		else {
			$('#content_menu_expand').hide();
		}
		return false;
	});
	$('#close_menu').click(function() {
		$('#content_menu_expand').hide();
		return false;
	});

	$("ul.menu_inside li a").hover(function() {
		$(this).parent().find("ul.subnav").slideDown(0).show();
		$(this).parent().hover(function() {
		}, function(){
			$(this).parent().find("ul.subnav").slideUp(0);
		});
	}).hover(function() {
		$(this).addClass("subhover");
	}, function(){
		$(this).removeClass("subhover");
	});
	new JsDatePick({
		useMode:2,
		target:"datefrom",
		dateFormat:"%Y-%m-%d"
		});
		new JsDatePick({
			useMode:2,
			target:"dateto",
			dateFormat:"%Y-%m-%d"
			});
		
	}
	

/*function xlsearch()
{
	if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
	}else{// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function(){
										  if (xmlhttp.readyState==4 && xmlhttp.status==200){
										    	document.getElementById("viewsearch").innerHTML=xmlhttp.responseText;
										  }
									  }
	sfromdate=document.getElementById("datefrom").value;
	stodate=document.getElementById("dateto").value;
	var setax = document.getElementById("cbcus");
	var scbcus = setax.options[setax.selectedIndex].value;
	xmlhttp.open("GET","ajax/acc/searchpurchase.php?search=Search&datefrom="+sfromdate+"&dateto="+stodate+"&cbcus="+scbcus,true);
	xmlhttp.send();
}*/
/*function sort(page,str,co,s)
{
	sfromdate=document.getElementById("datefrom").value;
	stodate=document.getElementById("dateto").value;
	//var setax = document.getElementById("cbcus");
	//var scbcus = setax.options[setax.selectedIndex].value;
	var scbcus = document.getElementById("inputString").value;
	//alert(sfromdate+" --- "+stodate+" --- "+scbcus+" -- "+s);
	if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
	}else{// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function(){
										  if (xmlhttp.readyState==4 && xmlhttp.status==200){
										    	document.getElementById("viewsearch").innerHTML=xmlhttp.responseText;
										    	resetvalue();
										  }
									  }
	xmlhttp.open("GET","ajax/acc/sortsearchpurchase.php?datefrom="+sfromdate+"&dateto="+stodate+"&cbcus="+encodeURI(scbcus)+"&page="+page+"&str="+str+"&co="+co+"&search="+s,true);
	xmlhttp.send();
}*/

function clickCustomer(gt){
	document.getElementById("inputString").value=gt;
	$('#content_menu_expand').hide();
}

function viewclick(status){
	//var txtloaitimkiem =$('input[name=abc]:checked').val();
	//alert(txtloaitimkiem);
	if(document.getElementById("abc_ngay").checked==true){
		txtloaitimkiem='ngay';
	}
	if(document.getElementById("abc_thang").checked==true){
		txtloaitimkiem='thang';
	}
	if(document.getElementById("abc_qui").checked==true){
		txtloaitimkiem='qui';
	}
	if(document.getElementById("abc_all").checked==true){
		txtloaitimkiem='all';
	}
	
	
	var typedate =$('input[name=ngaysearch]:checked').val();
	
	if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
	}else{// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	/*var body = document.getElementById('content_code');
	body.setAttribute('style','opacity:.5; position:relative;cursor: wait;  ');
	var d=document.createElement('div');
	d.setAttribute('style','display: block;visibility: visible; position: absolute;  z-index: 999; top: 0px; left: 0px; width: 105%; height: 105%; text-align: center;  filter: alpha(opacity=5); opacity: 0.5; ');
	d.setAttribute('id','hanhanhan');
	var image=document.createElement('img');
	image.setAttribute('src','images/loading1.gif');
	image.setAttribute('style','position:absolute; left:0px; top:0px; right:0; bottom:0; margin:auto');
	d.appendChild(image);
    body.appendChild(d);*/
	xmlhttp.onreadystatechange=function(){
										  if (xmlhttp.readyState==4 && xmlhttp.status==200){
										    	document.getElementById("showview").innerHTML=xmlhttp.responseText;
										    	/*document.getElementById('content_code').setAttribute('style','opacity:1; position:relative;');
										    	document.getElementById('hanhanhan').style.display='none';
										    	document.getElementById('content_code').parentNode.removeChild('hanhanhan');*/
										  }
									  }
	if(txtloaitimkiem=="all"){
		var cusname=document.getElementById("inputString").value;
		xmlhttp.open("GET","ajax/acc/or_search_invoice_tax_month.php?loaitimkiem=all&cusname="+encodeURI(cusname)+"&typedate="+typedate+"&status="+status,true);
		xmlhttp.send();
	}else if(txtloaitimkiem=="ngay"){
		var cusname=document.getElementById("inputString").value;
		var df=document.getElementById("datefrom").value;
		var dt=document.getElementById("dateto").value;
		xmlhttp.open("GET","ajax/acc/or_search_invoice_tax.php?loaitimkiem=ngay&df="+df+"&dt="+dt+"&cusname="+encodeURI(cusname)+"&typedate="+typedate+"&status="+status,true);
		xmlhttp.send();
	}else if(txtloaitimkiem=="thang"){
		var cusname=document.getElementById("inputString").value;
		var eyear = document.getElementById("syear");
		var txtyear = eyear.options[eyear.selectedIndex].value;
		var emon = document.getElementById("smonths");
		var txtmon = emon.options[emon.selectedIndex].value;
		xmlhttp.open("GET","ajax/acc/or_search_invoice_tax_month.php?loaitimkiem=thang&nam="+txtyear+"&thang="+txtmon+"&cusname="+encodeURI(cusname)+"&typedate="+typedate+"&status="+status,true);
		xmlhttp.send();
	}else if(txtloaitimkiem=="qui"){
		var cusname=document.getElementById("inputString").value;
		var eyear = document.getElementById("qyear");
		var txtyear = eyear.options[eyear.selectedIndex].value;
		var emon = document.getElementById("qmonths");
		var txtmon = emon.options[emon.selectedIndex].value;
		xmlhttp.open("GET","ajax/acc/or_search_invoice_tax_qui.php?loaitimkiem=qui&nam="+txtyear+"&qui="+txtmon+"&cusname="+encodeURI(cusname)+"&typedate="+typedate+"&status="+status,true);
		xmlhttp.send();
	}
}

function changeyear(type){
	var eyear = document.getElementById("syear");
	var txtyear = eyear.options[eyear.selectedIndex].value;
	var emon = document.getElementById("smonths");
	var txtmon = emon.options[emon.selectedIndex].value;
	if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
	}else{// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function(){
										  if (xmlhttp.readyState==4 && xmlhttp.status==200){
										    	document.getElementById("showtime").innerHTML=xmlhttp.responseText;
										  }
									  }
	xmlhttp.open("GET","ajax/acc/or_search_invoice_tax_time.php?type="+type+"&year="+txtyear+"&mon="+txtmon,true);
	xmlhttp.send();
}
function changeDistinction1(status){
	if(document.getElementById("abc_ngay").checked==true){
		type='ngay';
	}
	if(document.getElementById("abc_thang").checked==true){
		type='thang';
	}
	if(document.getElementById("abc_qui").checked==true){
		type='qui';
	}
	if(document.getElementById("abc_all").checked==true){
		type='all';
	}

	
	if(window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
	}else{// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function(){
										  if (xmlhttp.readyState==4 && xmlhttp.status==200){
										    	document.getElementById("idtab").innerHTML=xmlhttp.responseText;
										    	if(window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
										    		xmlhttp=new XMLHttpRequest();
										    	}else{// code for IE6, IE5
										    		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
										    	}
										    	xmlhttp.onreadystatechange=function(){
										    										  if (xmlhttp.readyState==4 && xmlhttp.status==200){
										    										    	document.getElementById("showview").innerHTML=xmlhttp.responseText;
										    										    	Load();
										    										  }
										    									  }
										    	xmlhttp.open("GET","ajax/acc/resetShowView.php?status="+status,true);
										    	xmlhttp.send();
										  }
									  }
	xmlhttp.open("GET","ajax/acc/changeDistinction.php?abc="+type+"&status="+status,true);
	xmlhttp.send();
}
function changeDistinction(type,status){
	if(window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
	}else{// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function(){
										  if (xmlhttp.readyState==4 && xmlhttp.status==200){
										    	document.getElementById("idtab").innerHTML=xmlhttp.responseText;
										    	if(window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
										    		xmlhttp=new XMLHttpRequest();
										    	}else{// code for IE6, IE5
										    		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
										    	}
										    	xmlhttp.onreadystatechange=function(){
										    										  if (xmlhttp.readyState==4 && xmlhttp.status==200){
										    										    	document.getElementById("showview").innerHTML=xmlhttp.responseText;
										    										    	Load();
										    										  }
										    									  }
										    	xmlhttp.open("GET","ajax/acc/resetShowView.php?status="+status,true);
										    	xmlhttp.send();
										  }
									  }
	xmlhttp.open("GET","ajax/acc/changeDistinction.php?abc="+type+"&status="+status,true);
	xmlhttp.send();
}
function changequi(type){
	var eyear = document.getElementById("qyear");
	var txtyear = eyear.options[eyear.selectedIndex].value;
	var emon = document.getElementById("qmonths");
	var txtmon = emon.options[emon.selectedIndex].value;
	if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
	}else{// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function(){
										  if (xmlhttp.readyState==4 && xmlhttp.status==200){
										    	document.getElementById("showtime").innerHTML=xmlhttp.responseText;
										  }
									  }
	xmlhttp.open("GET","ajax/acc/or_search_invoice_tax_time.php?type="+type+"&year="+txtyear+"&qui="+txtmon,true);
	xmlhttp.send();
}

function changedatefrom(){
	//var t=document.getElementById("dateto").value;
	//document.getElementById("vttime").value=vl+" ~ "+t;
	//alert(document.getElementById("vttime").value);
}

function dokhung(){
	var gt=document.getElementById("checkkhung").checked;
	if(gt==true){
		document.getElementById("inputString").value="";
		document.getElementById("inputString").style.backgroundColor ="#e9edf4";
		$("#inputString").attr('readonly', 'readonly');
	}else{
		document.getElementById("inputString").value="";
		document.getElementById('inputString').style.backgroundColor ="#ffffff";
		$("#inputString").removeAttr('readonly');
		document.getElementById('inputString').focus();
	}
}
</script>
 <link rel="stylesheet" type="text/css" href="admin/css/jsDatePick_ltr.min.css" />

<script type="text/javascript" src="admin/css/jsDatePick.min.1.3.js"></script>

<script type="text/javascript">

window.onload = function(){

new JsDatePick({
useMode:2,
target:"datefrom",
dateFormat:"%Y-%m-%d"
});
new JsDatePick({
	useMode:2,
	target:"dateto",
	dateFormat:"%Y-%m-%d"
	});

};

</script>
<link	href="css/style.css" rel="stylesheet" type="text/css" />
<div  class="title" style="padding-top: 5px;font-weight: bold;"><?php echo $l_accountant;?> &rarr; <?php if($status==0)echo $l_search_invoice_tax; else echo $l_SearchPurchase;?></div>
<div class="content_code" id="content_code">
	
		<div class="approval-right">	
			<table cellpadding="0" cellspacing="0" width="100%" border="1" class="atable" >	
				<tr>
					<td class="ffirst" style="text-align:left;height:24px;width: 180px;"><span>*</span><?=$l_ngay?></td>
		                <td style="text-align:left;">
			                <label style="padding-left: 10px"><input type="radio" onclick="changeDistinction1(<?=$status?>)"  id="ngayph" name="ngaysearch" value="ngayph" checked="checked"/><?=$l_ngayphathanh?></label>
			                <label style="padding-left: 10px"><input type="radio" onclick="changeDistinction1(<?=$status?>)"  id="ngaygd" name="ngaysearch" value="ngaygd"/><?=$l_ngaygiaodich?></label>
			                
		                </td>
				</tr>
			</table>	
	

			<form action="" method="post" name="f_ac_elisoft_search_order_tax">
        		<input type="hidden" name="content" value="ac_elisoft_search_order_tax_content" />
 			<div style="width:100%" id="idtab">
 				<table cellpadding="0" cellspacing="0" width="100%" border="1" class="atable" >		
		        	<tr>
		            	<td class="ffirst" style="text-align:left;height:24px;width:180px;"><span>*</span><?=$l_phanbiet?></td>
		                <td style="text-align:left">
			                <label style="padding-left: 10px"><input type="radio" onclick="changeDistinction('ngay',<?=$status?>)" id="abc_ngay" name="abc_ngay" value="ngay"  <?php if ($_REQUEST["abc"]=="ngay") echo "checked";?> /><?=$l_theongay?></label>
			                <label style="padding-left: 10px"><input type="radio" onclick="changeDistinction('thang',<?=$status?>)" id="abc_thang" name="abc_thang" value="thang"  <?php if ($_REQUEST["abc"]=="thang") echo "checked";?> /><?=$l_theothang?></label>
			                <label style="padding-left: 10px"><input type="radio" onclick="changeDistinction('qui',<?=$status?>)" id="abc_qui" name="abc_qui" value="qui"  <?php if ($_REQUEST["abc"]=="qui") echo "checked";?> /><?=$l_theoqui?></label>
			                <label style="padding-left: 10px"><input type="radio" onclick="changeDistinction('all',<?=$status?>)" id="abc_all" name="abc_all" value="all"  <?php if ($_REQUEST["abc"]=="all") echo "checked";?> /><?=$l_all?></label>
		                </td>
		                <?php 
		                if ($_REQUEST["abc"]!="all"){
	                		if($_REQUEST["abc"]=="ngay"){
	                			?>
	                			<!-- <td class="ffirst" style="text-align:left"><span>*</span><?php echo $l_days;?></td>
	                			<td  style="text-align:left;">
		                			<input type="text" id="datefrom" name="datefrom" value="<?=$_REQUEST['datefrom']?>" class="ftext" readonly="readonly"/> ~ 
		                			<input onchange="changedatefrom();" type="text" id="dateto" name="dateto" value="<?=$_REQUEST['dateto']?>" class="ftext" readonly="readonly"/>
	                			</td>  -->
	                			<td colspan="2"></td>
	                			<?php 
	                		}else if($_REQUEST["abc"]=="thang"){
	                			?>
	                			<td class="ffirst" style="text-align:left"><span>*</span><?php echo $l_year."-".$l_month;?></td>
	                			<td  style="text-align:left;">
	                				<div style="width:100%;padding-left:9px;">
		                			<select onchange="changeyear('thang');" style="width:80px;height:22px;font-size:12px;" id="syear" name="syear">
										<?php for($i=2012;$i<=$vyear;$i++){?>
											<option value="<?=$i?>"  
												<?php 
													if($i==$_REQUEST['syear']){
														?>
														selected="selected"
														<?php 
													}
												?>
											>
												<?php echo $i?>
											</option>
										<?php }?>
									</select>  
		                			<select onchange="changeyear('thang');" style="width:50px;height:22px;font-size:12px;" id="smonths" name="smonths">
										<?php for($i=1;$i<=12;$i++){?>
											<option value="<?=$i?>"  
												<?php 
													if($i==$_REQUEST['smonths']){
														?>
														selected="selected"
														<?php 
													}
												?>
											>
												<?php echo $i?>
											</option>
										<?php }?>
									</select>  
									</div>
	                			</td>
	                			<?php 
	                		}else if($_REQUEST["abc"]=="qui"){
	                			?>
	                			<td class="ffirst" style="text-align:left"><span>*</span><?php echo $l_year."-".$l_quy;?></td>
	                			<td  style="text-align:left;">
	                				<div style="width:100%;padding-left:9px;">
		                			<select onchange="changequi('tinhqui');" style="width:80px;height:22px;font-size:12px;" id="qyear" name="qyear">
										<?php for($i=2012;$i<=$vyear;$i++){?>
											<option value="<?=$i?>"  
												<?php 
													if($i==$_REQUEST['qyear']){
														?>
														selected="selected"
														<?php 
													}
												?>
											>
												<?php echo $i?>
											</option>
										<?php }?>
									</select>  
		                			<select onchange="changequi('tinhqui');" style="width:50px;height:22px;font-size:12px;" id="qmonths" name="qmonths">
										<?php for($i=1;$i<=4;$i++){?>
											<option value="<?=$i?>"  
												<?php 
													if($i==$_REQUEST['qmonths']){
														?>
														selected="selected"
														<?php 
													}
												?>
											>
												<?php echo $i?>
											</option>
										<?php }?>
									</select>  
									</div>
	                			</td>
	                			<?php 
	                		}
		                }
		                ?>
		                
		            </tr>
		            <tr>
		            <?php 
		            if ($_REQUEST["abc"]!="all"){
		            	if($_REQUEST["abc"]=="ngay"){
                		?>
                			<td class="ffirst" style="text-align:left"><span>*</span><?php echo $l_thoigiangiaodich;?></td>
                			<td  style="text-align:left;">
	                			<input type="text" id="datefrom" name="datefrom" value="<?=$_REQUEST['datefrom']?>" class="ftext" readonly="readonly" style="font-size:12px;font-weight:bold;text-align:center;"/> ~ 
	                			<input type="text" id="dateto" name="dateto" value="<?=$_REQUEST['dateto']?>" class="ftext" readonly="readonly" style="font-size:12px;font-weight:bold;text-align:center;"/>
                			</td>
                		<?php 
                		}else{
		            	?>
		            	<td class="ffirst" style="text-align:left"><span></span><?=$l_thoigiangiaodich?></td>
		                <td style="text-align:left">
							<div id="showtime" style="padding-left:9px";>
								<input type="text" id="vttime" name="vttime" value="<?=$_REQUEST['vttime']?>" style="border:none;background:none;width:200px;font-size:12px;font-weight:bold;" readonly="readonly"/>
							</div>
						</td>
		            	<?php 
	                	}
		            }
		            ?>
		                <td class="ffirst" style="text-align:left"><span></span><?=$l_company_name?></td>
		                <td style="text-align:left">
		                	<div style="position:relative;padding-left:9px;">
								<div style="float:left;">
									<input  type="text" size="30" value="<?=$_REQUEST['cbcus']?>" name="cbcus" id="inputString"  style="height: 22px; width: 300px; border: 1px solid #c4c0c9;font-size: 12px;" autocomplete="off"; />
									<div class="suggestionsBox" id="suggestions" style="display:none;">
										<img src="images/upArrow.png" style="position: relative; top: -12px; left: 30px;" alt="upArrow" />
										<div class="suggestionList" id="autoSuggestionsList">
											&nbsp;
										</div>
									</div> 						
								</div>
								<div style=" float:left; position:relative; margin-top: 4px; margin-left: -24px; z-index:999">
									<img alt="" src="images/arrow-down.png" id="menu_expand" >
								    <div id="content_menu_expand" class="passul" style="display:none;">
								        <ul>
								        <?php 
								    		$sql="select ac_customer.CustomerName from ac_customer where ac_customer.Activest=1";
											$result = mysql_query($sql);
											if($result)
											{
												$i=0;
												while($row=mysql_fetch_array($result))
												{
													?>
													<li onmouseover="this.style.cursor='pointer'"  onmouseout="this.style.cursor='default'" onclick="clickCustomer('<?=$row['CustomerName']?>')" 
														<?php 
															if($i%2!=0){
																?>
																class="bgkhac"
																<?php 
															}
														?>
													> <?php echo $row['CustomerName'];?></li>
													<?php 
													$i++;
												}
											}
								    	?>
								        </ul>
								    </div>
								</div>
							</div>
							<div style="padding:5px;">
								<label style="padding-left: 10px"><input type="checkbox" name="checkkhung" id="checkkhung" value="<?=$_REQUEST['checkkhung']?>" onclick="dokhung()" />&nbsp;<?=$l_all?></label>
							</div>
		                </td>
		            </tr>
		        </table>
 			</div>    
 			<div style="text-align:center;">
	        	<input onclick="viewclick(<?=$status?>);" type="button" value="<?=$l_search?>" class="btnupbg btnupload" style="background: #4f81bd;" />
	        </div>   
	        <div style="clear:both"><br><br></div>  
	        <div id="showview" style="width:100%">
	        	<div class="title2">
			    	<!-- <span style="float:left"><?php echo $l_company_name?> : ELisoft</span>
			        <span style="float:right">
			        	<?php 
			        		if($_REQUEST['cbcus']!=""){
			        			?>
			        			<?php echo $l_tenkhachhanggiaodich;?> : <?php echo $_REQUEST['cbcus'];?>
			        			<?php 
			        		}
			        	?>
			        </span> -->
			    </div>
			    <div style="clear:both"></div>
	        	<div style="position:relative">
			        	<table cellpadding="0" cellspacing="1" width="100%" border="0" class="ftable">
				            <tr>
				                <th><?=$l_no?></th>
				                <th><?=$l_ngaythangnam?></th>
				                <th><?=$l_company_name?></th>
				                <th width="30%"><?=$l_product_item?></th>
				                <th><?=$l_quantity?></th>
				                <th><?=$l_Supply_price?></th>
				                <th><?=$l_vat?></th>
				                <th><?=$l_amount?></th>
				                <th><?=$l_thoigiangiaodich?></th>
				            </tr>
				           
				            <tr class="coltr2" style="font-weight:bold;font-size:14px;">
				                 <td colspan="4"  style="padding: 10px;">
									<?php 
										if($_SESSION['loaitimkiem']=="thang"){
											?>
											<?php echo $l_month;?> : <font color="red"><?php echo $thoigian; ?></font>  -  <?php echo $l_giaodich;?> : <font color="blue"><?php echo number_format($dem);?></font> 
											<?php 
										}else if($_SESSION['loaitimkiem']=="qui"){
											?>
											<?php echo $l_month;?> : <font color="red"><?php echo $thoigian; ?></font>  -  <?php echo $l_giaodich;?> : <font color="blue"><?php echo number_format($dem);?></font> 
											<?php 
										}else{
											?>
											<?php echo $l_days;?> : <font color="red"><?php echo $thoigian; ?></font>  -  <?php echo $l_giaodich;?> : <font color="blue"><?php echo number_format($dem);?></font> 
											<?php 
										}
									?>
								</td>
				                <td></td>
				                <td style="text-align:right;"><?php echo number_format($tonggiacungcap);?></td>
				                <td style="text-align:right;"><?php echo number_format($tongthue);?></td>
				                <td style="text-align:right;"><?php echo number_format($tongtien);?></td>
				                <td></td>
				            </tr>
				            <tr style="font-weight:bold;font-size:15px;color:green;">
				                <td colspan="4" style="padding: 10px;"><?php echo $l_tongdon?></td>
				                <td></td>
				                <td style="text-align:right;"><?php echo number_format($stonggiacungcap);?></td>
				                <td style="text-align:right;"><?php echo number_format($stongthue);?></td>
				                <td style="text-align:right;"><?php echo number_format($stongtien);?></td>
				                <td style="text-align:right;"></td>
				                <td style="text-align:right;"></td>
				            </tr>
				        </table>
        		</div>
        		<?php 
        		if(count($arr)>0){
        			?>
        			<div class="fbox2"><input type="button" value="Xuat file exe" class="btnupbg btnupload" style="background: #4f81bd;"/></div>
        			<div class="fbox2"><input type="button" value="<?=$l_print?>" class="btnupbg btnupload" style="background: #4f81bd;"/></div>
        			<?php 
        		}
        		?>
        		
	        </div>
	        </form>              	
		</div>
	
</div>